cmake_minimum_required (VERSION 3.15)

project(core_lib CXX)
foreach(dirname ${CMAKE_CURRENT_SOURCE_DIR})
    file(GLOB_RECURSE SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
            "${dirname}/*.h"
            "${dirname}/*.hpp"
            "${dirname}/*.c"
            "${dirname}/*.cpp"
            )
endforeach()

add_library(${PROJECT_NAME} STATIC ${SRC})

find_package(Threads REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads)
target_link_libraries(${PROJECT_NAME} PUBLIC  usbcan)

#find_package(jsoncpp CONFIG REQUIRED)
#target_link_libraries(${PROJECT_NAME} PUBLIC JsonCpp::JsonCpp)

find_package(PkgConfig REQUIRED)
pkg_check_modules(libusb REQUIRED IMPORTED_TARGET libusb-1.0)
target_link_libraries(${PROJECT_NAME} PUBLIC PkgConfig::libusb)



target_link_libraries(${PROJECT_NAME} PUBLIC MultiTool)
